home *** CD-ROM | disk | FTP | other *** search
- /*
- * (c) Copyright 1992 by Panagiotis Tsirigotis
- * All rights reserved. The file named COPYRIGHT specifies the terms
- * and conditions for redistribution.
- */
-
- #ifndef STATE_H
- #define STATE_H
-
- /*
- * $Id: state.h,v 5.1 1992/10/31 23:59:07 panos Exp $
- */
-
- #include <setjmp.h>
-
- #include "pset.h"
- #include "xlog.h"
-
- #include "mask.h"
- #include "service.h"
-
- struct read_only_state
- {
- int orig_max_descriptors ; /* before we change the resource limit */
- int max_descriptors ; /* as returned by getdtablesize() */
- int process_limit ; /* if 0, there is no limit */
- unsigned loop_rate ;
- char *config_file ;
- int is_superuser ;
- char **Argv ;
- int Argc ;
- } ;
-
-
- struct config_state
- {
- struct service *defaults ;
- xlog_h common_log ;
- bool_int common_log_creation_failed ;
- } ;
-
-
- struct read_write_state
- {
- int descriptors_free ;
- int available_services ; /* # of available services */
- int active_services ; /* services with descriptors set in */
- /* socket mask */
- fd_set socket_mask ;
- int mask_max ;
- pset_h servers ; /* table of running servers */
- pset_h retries ; /* table of servers to retry */
- pset_h services ; /* table of services */
- struct service *logging ;
- struct service *shutdown ;
- struct config_state cs ;
- xlog_h program_log ;
- jmp_buf env ;
- bool_int env_is_valid ;
- } ;
-
- struct program_state
- {
- mask_t flags ;
- struct read_only_state ros ;
- struct read_write_state rws ;
- } ;
-
- #define DEFAULTS( ps ) CONF( (ps).rws.cs.defaults )
- #define DEFAULT_LOG( ps ) (ps).rws.cs.common_log
- #define DEFAULT_LOG_ERROR( ps ) (ps).rws.cs.common_log_creation_failed
- #define LOG_SERVICE( ps ) (ps).rws.logging
- #define SHUTDOWN_SERVICE( ps ) (ps).rws.shutdown
- #define SERVICES( ps ) (ps).rws.services
-
- extern struct program_state ps ;
-
- #endif /* STATE_H */
-